perm filename PAS.HLP[UP,DOC]1 blob
sn#500356 filedate 1980-04-14 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00006 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 PAS acts as a pseudo-monitor for the S-1 Pascal/Fortran system
C00006 00003 A PAS command consists of "R PAS" followed by a FILENAME followed by
C00010 00004 ROUTING SWTICHES
C00012 00005 A quick review:
C00016 00006 Notes on implementation:
C00021 ENDMK
C⊗;
PAS acts as a pseudo-monitor for the S-1 Pascal/Fortran system
at SAIL, putting into the user's input buffer the right commands to get a
program from its source to actually running it on the simulator, or any
subset of the complete path. It supersedes the DO file system. The best
way of seeing how it works is to look at the examples at the end of this
document (do this now).
A PAS command consists of "R PAS;" followed by a FILENAME followed by
any number of SWITCHES.
The last PAS command can be re-executed by typing "R PAS". It can also
be re-executed by typing "EX" or control-x followed by "G" to the editor
PROVIDING you have not done any compilation with any other compilers or used
DO, DRD, or PUB since your last PAS command.
FILENAMES
---------
A filename is of the form FNAME.EXT[PRJ,PRG], where anything except FNAME
is optional. EXT may be any one of the following: PAS, FOR, PCO, UCO, LDI.
If you leave out EXT, PAS will try out those extensions in that order until
it finds a file.
All further files in a chain (FNAME.PCO, FNAME.LDI, etc.) will be written
to your current area, not to [PRJ,PRG].
TERMINATION FILES and MODES
---------------------------
If you want to look at some intermediate results instead of going through
the whole chain, you can specify a termination file, or you can use the
"single step" switch (/S), which will cause only one phase of the translation
to be done.
Possible termination files are: /PCO, /UCO, /LDI, /OP, /PS1, /RIM, /IN,
/OUT, /RUN, /TTYIN, /TTYOUT, and /RUNTTY.
There two special termination modes: E (edit) and D (debug). E means that
you want to edit the termination file afterwards. D means that you want to
debug the program that generates the termination file (or the last program,
if no termination file.) This means and "END" will not be generated for
a Pascal program, and a αg will not be generated for the simulator.
Special termination files:
RIM causes a FNAME.RIM to be written out by FSIM after it has loaded FNAME.LDI.
IN and OUT can be used to specify default input and output files to the
simulator. For instance,"R PAS;FNAME/OUT" will cause PAS to
feed FNAME.OUT to the simulator for the name of file OUTPUT.
"RUN" means to use the file FNAME.RUN for Fortran run-time messages.
TTYIN, TTYOUT, and TTYRUN means to use the TTY instead of a file for
input, output, or Fortran run-time messages.
These file names are ALWAYS output in the order RUN, IN, OUT.
ROUTING SWTICHES
----------------
/U use U-code (PTRANS) rather than P-code
/S single-step (do only one phase of the translation)
/UP use UPAS rather than PCPASC and PTRANS
/INT use interpreter rather than SOPU and the simulator
/FOR use Fortran run-times
/OLD use old (pre-set change) PCPASC,SOPA,and runtimes
/S1WORD also load current S1WORD.LDI
/DDT also load DDT.LDI
OTHER SWITCHES
--------------
/Cn increases core to n when running translator programs
/CFn increases core to n when running on simulator (using
αxCORE command)
/XX print all commands in the chain instead of feeding them
to TTY input buffer (for debugging)
/<fname> will use a specified version of SOPA, SOPU, UPAS,
or PCPASC instead of the default one. <fname> must
always start with SOP, SUP, UPAS, or PCP. Default area
is your current area.
A quick review:
Meaning of file extensions:
Extension file type
--------- ---------
.PAS Pascal source file
.FOR Fortran source file
.PCO P-code file
.UCO U-code file
.LDI Loader-format file, for running on the simulator or the S-1
.RIM Core image file output by loader
The usual paths:
file translated by file translated by file translated by file
---- ------------- ---- ------------- ---- ------------- ----
.PAS PCPASC .PCO SOPA .LDI
.PAS PCPASC .PCO PTRANS .UCO SOPU .LDI
.PAS UPAS .UCO SOPU .LDI
.FOR PCFOR .PCO SOPA .LDI
.FOR UCFOR .UCO SOPU .LDI
Some examples of the use of PAS:
R PAS;FNAME (compiles FNAME.PAS or FNAME.FOR and runs it on the simulator)
EX (usually re-executes last PAS command (also control-X G from
the editor))
R PAS (ALWAYS re-executes the last PAS command)
R PAS;FNAME.PCO (put FNAME.PCO through SOPA and run it on the simulator)
R PAS;FNAME.PCO/S (put FNAME.PCO through SOPA (S = single step))
R PAS;FNAME/PS1/E (translate FNAME.PAS to FNAME.PS1 and edit the result)
R PAS;FNAME/OUT (compile and run FNAME.PAS, feeding FNAME.OUT to FSIM
for the Pascal output file)
R PAS;FNAME.LDI/TTYOUT (run FNAME.LDI on simulator, use "TTY:" for output)
R PAS;FNAME/U (use U-code system (PTRANS) instead of P-code system)
R PAS;FNAME/UP (use U-code system (UPAS) instead of P-code system)
R PAS;FNAME/INT/E (compile FNAME.PAS into U-code, run it on the interpreter,
using FNAME.OUT for OUTPUT, then look at the result)
R PAS;FNAME/LDI/D (don't say "END" to debugger when running SOPA (D stands
for "DEBUG")
R PAS;FNAME.LDI/FOR/RIM (load FNAME.LDI using Fortran run-times and write
out the RIM file)
R PAS;FNAME/C128 (increase core for PCPASC and SOPA to 128K)
R PAS;FNAME/CF100000 (when running on simulator, increase core to 100000)
R PAS:FNAME/OLD/S1WORD (use old SOPA, PCPASC, and runtime (PASSIX), and
also load S1WORD)
R PAS;TEST.PAS/SOPZ11 (use SOPZ11 instead of the current SOPA)
R PAS;? (display this file)
Notes on implementation:
The PAS system consists of two programs: PAS and PAS2.
The first parses the user's command line, figures out what she wants,
puts the proper commands for the first phase of the translation
in the user's input buffer, and
stores the commands for later phases in a file. THe last command
it emits is "R PAS2". PAS2 gets the commands from the file
for each successive phase and outputs them to the user's input buffer.
The procedure SCANLINE get's the user's command line and
parses it. If the user doesn't give a file name explicitly, then
PAS uses the file name that it used the last time it was invoked.
This information is stored by PAS in two TMPCOR files (see UUO manual
for more about TMPCOR files). It stores it in the TMPCOR file S1 so
that it will always have a record of the last thing it did, and it
stores it in the file COM, so that it will be invoked by the next
compile-class command by SNAIL or E (that is, if the user types EX
to the monitor or control-G to E). For this file, it includes
not only the appropriate arguments (the file name specified by the
user and the switches) but also "/PROC SYS:PAS", so SNAIL and E
know to run the PAS program.
Once it gets the command line, it uses the procedure ParseName
to get the file name and fill in default extension, PPN, etc., if necessary.
It then parses the switches, returning them in the array SWITCHES. It
doesn't interpret the switches except for the two core size switches,
C<n> and CF<n>. For these two, it reads the integer <n> and returns
it in either CORE or FSIMCORE.
After SCANLINE is done, FINDSWITCH is called to interpret each
switch and set the appropriate boolean variable. Then the actual
command generation starts. Each set of commands is divided up into
PHASES, one phase for each program that is to be run. Each phase has
a source file and an object file associated with it. For instance,
for SOPA the source file would be PAS and the result file LDI.
PAS knows it has reached the final phase when the result file matches
the termination file.
Each phase is divided up into two parts. The first parts
determines the appropriate program to run and the names of all of
the files to feed to it. The second part, FinishCall, determines
if this is the last phase. If not, "END" (for the debugger) and
"R PAS2" (for the monitor, so that the next group of commands can
be retrieved) are added. Otherwise, any special termination situations
are taken care of (such as /E or /D), and CURFILE is set to 0 to signal
the end of command generation.